package com.heima.wemedia.config;

import net.sourceforge.tess4j.ITesseract;
import net.sourceforge.tess4j.Tesseract;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author jack
 * @data 2024 11:17
 */
@Configuration
public class TesseractConfig {

    @Bean
    public Tesseract tesseract(Tess4jProperties tess4jProperties){
        Tesseract tesseract = new Tesseract();
        //设置字体库路径
        tesseract.setDatapath(tess4jProperties.getDatapath());
        //中文识别
        tesseract.setLanguage(tess4jProperties.getLanguage());
        return tesseract;
    }
}
